package foxmob.mooc.file;

import foxmob.mooc.Utils;
import spark.Request;
import spark.Response;

import static spark.Spark.post;

public class FileHandler {
    public static void  init(){
        post("/file/upload", FileHandler::upload);

    }

    public static String upload(Request req, Response res){
        String fname[] = Utils.getMultipart(new String[]{"fname"},req);
        Utils.storeFile(req,"file",fname[0]);

        return "{}";
    }
}
